<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>导师认证</title>
		<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css"/>
		<link rel="stylesheet" href="../css/style.css" />
		<link rel="stylesheet" href="../css/leftSidebar.css">
	</head>
	<style type="text/css">
	html,body{}
		.col-xs-12.nav_right{padding: 0;height: 100px;padding-right: 0;margin-right: 0;min-width: 1100px;height: 100px;padding-right: 0;margin-right: 0;padding-left: 160px;}
		#myTab a{color: #7c7c7c; font-size: 15px;}
		#myTab>li.active>a{color: #3f4142; background-color: #fff;}
		.navbar-form{margin-top: 0;}
		.tab_creat .active{color:#6bc50d;}
		.table>tbody>tr.active>td, .table>tbody>tr.active>th, .table>tbody>tr>td.active, .table>tbody>tr>th.active, .table>tfoot>tr.active>td, .table>tfoot>tr.active>th, .table>tfoot>tr>td.active, .table>tfoot>tr>th.active, .table>thead>tr.active>td, .table>thead>tr.active>th, .table>thead>tr>td.active, .table>thead>tr>th.active{background-color: #fff;}
		.table>tfoot>tr.active>td{background-color: #fff;}
		.table>tbody>tr>td{border-top:0;}
		.table{margin-bottom: 0;}
		div.tab_creat.row{background-color: #fff;}
		.tab_font{padding: 10px 0;}
		.tab_font div,.tab_font td{font-size: 14px;color: #919191;}
		.gongsi_list div.col-xs-2{padding-top:10px;padding-bottom: 10px;text-align: center;}
		.gongsi_list.row{padding: 20px;background-color: #fff;margin-top: 20px;border: 1px solid #ddd;}
		.gongsi_list dd div.col-xs-2{height: 60px;line-height: 60px;font-size: 14px; color: #4f5051;}
		.row{margin: 0;	}
		
		.sub_logo{position: relative;display: inline-block;padding-left: 0;}
		.sub_logo input{opacity: 0;position: absolute;width: 100%;top: 0;bottom: 0;}
		.zhube_head{border-bottom: 1px solid #ddd;}
		.zhube_head h3{padding:10px 5px 30px;, color: #222c38;font-size: 18px;font-weight: bold;}
			
		#form_test label{font-size: 14px; color: #515151;font-weight: normal;}
		#form_test  .media-middle{font-size: 14px;color: #acacac;}
		.form_tip{font-size: 12px;color: #acacac; }
		.btn-default{border-color: #d4252a;color: #d4252a;}
		.btn-default.disabled{background-color: #ccc;color: #fff;border-color:#ccc;}
		.btn-default.disabled.focus, .btn-default.disabled:focus, .btn-default.disabled:hover, .btn-default[disabled].focus, .btn-default[disabled]:focus, .btn-default[disabled]:hover, fieldset[disabled] .btn-default.focus, fieldset[disabled] .btn-default:focus, fieldset[disabled] .btn-default:hover{background-color: #ccc;color: #fff;}
		.btn_next{width: 180px;}
		.btn_next,.btn_back{margin-bottom: 50px;}
		
		.zhube_head>div{padding-bottom: 15px; color: #d4252a;font-size: 16px;}
		.zhube_head>div>.active{color: #919191;}
		
		#form_check label.col-xs-2 {padding:15px 0;}
	</style>
	<body style="background-color: #f2f2f2;">
		<div class="row warp" style="height: 100%;">
			<div class="nav_right_head">
				<a href="../index.html"><img src="../img/roleIndexBg.jpg"/></a>
			</div>

			<!--左侧导航-->
			<!--<div class="creatNav">导师服务</div>-->
			<!--<div class="col-xs-2 nav_left">-->
			<!--<div class="creatLoginStatus"><img src="../img/avtar.png"><a>您好，导师</a></div>-->
				<!--<div class="list-group" style="padding: 0;">-->
					<!--<a href="daoshi_index.html" class="list-group-item "><i class="glyphicon glyphicon-home"></i> 首页</a>-->
					<!--<a href="daoshirenzheng_1.html" class="list-group-item active"><i class="glyphicon glyphicon-education"></i> 导师认证</a>-->
					<!--<a href="daoshi_yxxm.html" class="list-group-item"><i class="glyphicon glyphicon-folder-open"></i> 已选项目</a>-->
					<!--<a href="daoshi_gzxm.html" class="list-group-item"><i class="glyphicon glyphicon-question-sign"></i> 关注项目</a>-->
					<!--<a href="daoshi_mynews.html" class="list-group-item" ><i class="glyphicon glyphicon-book"></i>  我的消息</a>-->
					<!--<a href="daoshi_lingyudongtai.html" class="list-group-item"><i class="glyphicon glyphicon-send"></i> 领域动态</a>-->
				<!--</div>-->
				<!--<div class="backBtn"> <a href="../index.html"><img src="../img/backIndex.png"></a></div>-->
			<!--</div>-->
			
			<div class="col-xs-12 nav_right">

				
			
					<div class="row" style="margin-top: 10px;">
						<div class="col-xs-8 col-xs-offset-2  zhuche_progress1" >
							<div class="zhube_head clearfix">
								<h3 class="text-center">导师认证</h3>
								<div class="row text-center"><span class="col-xs-4 ">第一步：提交身份信息</span> <span class="col-xs-4">>>></span><span class="col-xs-4 active">第二步：提交研究偏好信息</span></div>
							</div>
							<form class="form-horizontal" id="form_test" style="padding: 20px 0;"> 
							  <div class="form-group">
							    <label for="realName" class="col-sm-3 control-label">真实姓名</label>
							    <div class="col-sm-8">
							      <input type="text" class="form-control" id="realName" datatype="*" nullmsg="请输入真实姓名！" placeholder=" 为了保证创业者的沟通体验，请确保为真实姓名 ">
							    </div>
							  </div>
							  <div class="form-group">
							    <label for="email" class="col-sm-3 control-label">邮箱</label>
							    <div class="col-sm-8">
							      <input type="email" name="email" class="form-control" id="email" datatype="*" nullmsg="请输入邮箱！"  placeholder="输入邮箱">
							    </div>
							  </div>
							 
							   <div class="form-group">
							    <label for="weChat" class="col-sm-3 control-label">微信</label>
							    <div class="col-sm-8">
							      <input type="text" class="form-control" id="weChat" datatype="*" nullmsg="请输入微信号！" placeholder="输入微信号">
							    </div>
							  </div>
							   <div class="form-group">
							    <label for="edu" class="col-sm-3 control-label">学历</label>
							    <div class="col-sm-8">
							     <select class="form-control" id="edu" >
									  
									</select>
							    </div>
							  </div>
							  <div class="form-group">
							    <label for="dept" class="col-sm-3 control-label">单位</label>
							    <div class="col-sm-8">
							      <input type="text" class="form-control" datatype="*" nullmsg="请输入单位名称！" id="dept" placeholder="输入单位名称">
							    </div>
							  </div>
							  <div class="form-group">
							    <label for="awards" class="col-sm-3 control-label">获奖经历</label>
							    <div class="col-sm-8">
							      <textarea class="form-control" id="awards"  rows="3" placeholder="请填写主要的获奖经历"></textarea>
							    </div>
							  </div>
							  
							    <div class="form-group">
							    <label for="title" class="col-sm-3 control-label">职称</label>
							    <div class="col-sm-8">
									  <input type="text" class="form-control" id="title" datatype="*" nullmsg="请输入职称！" placeholder="输入职称">
							    </div>
							  </div>
							  
							  <div class="form-group">
							    <label for="area" class="col-sm-3 control-label">地区</label>
							    <div class="col-sm-8">
							     <select class="form-control" id="area" value="" >
									</select>
							    </div>
							  </div>
							  <input type="button" class="btn btn-default center-block btn_next" value="下一步"/>
							</form>
							
						</div>

						<div class="col-xs-8 col-xs-offset-2 zhuche_progress2">
							<div class="zhube_head clearfix">
								<h3 class="text-center">导师认证</h3>
								<div class="row text-center"><span class="col-xs-4  active">第一步：提交身份信息</span> <span class="col-xs-4">>>></span><span class="col-xs-4 ">第二步：提交研究偏好信息</span></div>
							</div>
							<form class="form-horizontal" id="form_check"  enctype="multipart/form-data" >
							<div class="row" style="text-align: center;" id="area_out">	
								<label class="checkbox-inline col-xs-2" style="margin-left: 10px;"><input type="checkbox" name="areas" id="inlineCheckbox1" value="1">汽车交通</label>
							</div>
							<input type="hidden" name="researchField" id="domain" datatype='*' nullmsg="请选择领域！" value="" />
							
							 
							
							
							<div class="form-group" style="margin: 20px 0 30px;">
							    <label for="up" class="col-sm-2 control-label" style=" margin-left: 15px;font-weight: normal;">个人名片</label>
							    <div class="col-sm-8">
							    	<div class="sub_logo col-xs-4">
							    	<img src="../img/020.jpg"style="vertical-align: middle;width: 90px;height: 90px;"  id="ImgPr"/>
							    		<input type="file" id="up" name="pic" datatype='*' nullmsg="请上传个人名片！" value="" multiple="multiple"/>
							    	</div>
							    <span class="media-middle" style="display: inline-block;margin-top: 30px;">建议上传尺寸90mm*50mm</span>
							    </div>
							  </div>
							  
							  <div class="form-group" style="margin: 20px 0 30px;">
							    <label for="up2" class="col-sm-2 control-label" style=" margin-left: 15px;font-weight: normal;">头像</label>
							    <div class="col-sm-8">
							    	<div class="sub_logo col-xs-4">
							    	<img src="../img/020.jpg"style="vertical-align: middle;width: 90px;height: 90px;"  id="ImgPr2"/>
							    		<input type="file" id="up2" name="avatarPic" datatype='*' nullmsg="请上传头像！" value="" multiple="multiple"/>
							    	</div>
							    <span class="media-middle" style="display: inline-block;margin-top: 30px;">建议上传尺寸90mm*50mm</span>
							    </div>
							  </div>
							  
							<input type="hidden" name="userId" id="userid" value="" />
							<input type="hidden" name="realName" value="" />
							<input type="hidden" name="email"  value="" />
							<input type="hidden" name="weChat"  value="" />
							<input type="hidden" name="education"  value="" />
							<input type="hidden" name="dept"  value="" />
							<input type="hidden" name="title"  value="" />
							<input type="hidden" name="area"  value="" />
							<input type="hidden" name="awards"  value="" />
							<div class="row"><input type="button" class="btn btn-default col-xs-3 col-xs-offset-3 btn_back"  value="上一步"/> <input type="button" class="btn btn-default col-xs-3 submit_btn" style="margin-left: 50px;" value="提交"/></div>
							</form>
							
							
						
							 
						</div>
				</div>
					
			
		</div>
		</div>
	</body>
	<script src="../js/jquery-2.1.1.min.js"></script>
	<script type="text/javascript" src="../js/bootstrap.min.js" ></script>
	<script type="text/javascript" src="../js/Validform_v5.3.2_min.js" ></script>
	<script type="text/javascript" src="../js/uploadimg.js" ></script>
	<script type="text/javascript" src="../js/public.js"></script>
	
	<script type="text/javascript">
		 var realName = "";
		 var email = "";
		 var weChat = "";
		 var education = "";
		 var dept = "";
		 var title = "";
		 var area_ = "";
		 var awards = "";
	var person = JSON.parse(sessionStorage.getItem("person"));

	if (person==''||person==null) {
		alert('请先注册')
		 window.location.href='denglu.html';
	} else{
	var userId = person.userid;
	
	}
 	
		 
	 $("#up").uploadPreview({ Img: "ImgPr", Width: 120, Height: 120 });
	  $("#up2").uploadPreview({ Img: "ImgPr2", Width: 120, Height: 120 });
	
	$("#form_test").Validform({
			btnSubmit:".btn_next",
			tiptype:1,
		ajaxPost:true,
		beforeCheck:function(){
//		$('#domain').val($('input[name="userpro"]:checked').val());
		},
		beforeSubmit:function(curform){
			realName=$('#realName').val();
			email=$('#email').val();
			weChat=$('#weChat').val();
			education=$('#edu').val();
			dept=$('#dept').val();
			title=$('#title').val();
			area_ = $('#area').val()
			awards = $('#awards').val();
			$(".zhuche_progress1").hide();
			$(".zhuche_progress2").show();
			
			return false;
			}
	});
	
	$("#form_check").Validform({
			btnSubmit:".submit_btn",
			tiptype:1,
		beforeCheck:function(){
		var domains = '';
			 $('input[name="areas"]:checked').each(function(){    
			   domains+=$(this).val()+','
			  });  
			domains=domains.substring(0,domains.length-1);
			  console.log(domains);
			  $('#domain').val(domains)	
		},
		beforeSubmit:function(curform){
			$('input[name="realName"]').val(realName);
			$('input[name="email"]').val(email);
			$('input[name="weChat"]').val(weChat);
			$('input[name="education"]').val(education);
			$('input[name="dept"]').val(dept);
			$('input[name="title"]').val(title);
			$('input[name="area"]').val(area_);
			$('input[name="awards"]').val(awards);
			$('#userid').val(userId);
			doUpload();
			return false;
		}
	});

	
	
		
		$(".zhuche_progress2").hide();
		$('.btn_back').on("click",function(){
			$(".zhuche_progress1").show();
			$(".zhuche_progress2").hide()
		})
		
		function doUpload() {  
	     var formData = new FormData($( "#form_check" )[0]);  
	     $.ajax({  
	          url: 'http://114.112.96.184:18080/auth/tutor' ,
	          type: 'POST',  
	          data: formData,  
	          async: false,  
	          cache: false,  
	          contentType: false,  
	          processData: false,  
	          success: function (data) {  
	           console.log(data);
	           if (data.code==000) {
	           	window.location.href='../index.html';
	           } 
	          },  
	          error: function (returndata) {  
	              alert(returndata);  
	          }  
	     });  
		}  
		
		
//		领域
			$.ajax({
                type: "get",
                url:"http://114.112.96.184:18080/dict/field",
                error: function(request) {
                    alert("Connection error");
                },
                success: function(data) {
                	console.log(data)
                   var obj = data.result;
                   var htmls='';
                   for (var i = 0; i < obj.length;i++) {
                   	
                   	htmls+= '<label class="checkbox-inline col-xs-2" style=""><input type="checkbox" name="areas"  value="'+ obj[i].id +'">'+obj[i].value+'</label>'
                   }
                   $('#area_out').html(htmls);
                }
            });
		
		
		//		地区	
	$.ajax({
                type: "get",
                url:"http://114.112.96.184:18080/dict/area",
                async: false,
                error: function(request) {
                    alert("Connection error");
                },
                success: function(data) {
                	console.log(data)
                   var obj = data.result;
                   var htmls='';
                   for (var i = 0; i < obj.length;i++) {
                   	htmls+= "<option value=" + obj[i].id +" >"+ obj[i].value  +"</option>"
                   }
                   $('#area').html(htmls);
                }
            });
            
            //学历
            $.ajax({
                type: "get",
                url:"http://114.112.96.184:18080/dict/edu",
                async: false,
                error: function(request) {
                    alert("Connection error");
                },
                success: function(data) {
                	console.log(data)
                   var obj = data.result;
                   var htmls='';
                   for (var i = 0; i < obj.length;i++) {
                   	 htmls+= "<option value=" + obj[i].id +" >"+ obj[i].value  +"</option>"
                   }
                   $('#edu').html(htmls);
                }
            });
	</script>
</html>
